﻿@model System.Data.DataTable 
@using System.Data; 

@{
    ViewBag.Title = "Upload";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Upload</h2>

<p>Upload file and import data to database takes long time. Please wait patiently.</p>

<p>
@using (Html.BeginForm("Upload", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    <input type="file" name="file" />
    <input type="submit" value="OK" />
}
</p>

<h3>The uploaded excel file should use following format:</h3>
@Html.ActionLink("Download Sample Excel File", "Download") 

<table> 
    <thead> 
    <tr> 
    @foreach (DataColumn col in Model.Columns)     
    {          
        <th>@col.ColumnName</th> 
    }     
    </tr> 
    </thead>         
    <tbody> 
    @foreach (DataRow row in Model.Rows)     
    {         
        <tr> 
        @foreach (DataColumn col in Model.Columns)         
        {       
            <td>@row[col.ColumnName]</td>
        }         
        </tr> 
    }     
    </tbody> 
</table> 


